import { Application } from 'egg';

export default (app: Application) => {
  const { router, controller } = app;
  const rootRouter = router.namespace('/api/v1');

  rootRouter.get('/', controller.home.index);
  rootRouter.get('/start', controller.home.addData);
  rootRouter.all('/insertDataByTime', controller.home.insertDataByTime);

  rootRouter.all('/sjsms', controller.home.smsSj);
  rootRouter.all('/sjsmstop', controller.home.smstop);
  rootRouter.all('/sjsmsTop10', controller.home.sjsmsTop10);

  rootRouter.all('/smsdetail', controller.home.smsdetail);
  rootRouter.all('/sjcall', controller.home.callSj);
  rootRouter.all('/tjcall', controller.home.calltj);
  rootRouter.all('/sjcallphone', controller.home.callsjphone);
  rootRouter.all('/exportnote', controller.home.exportNote);

  rootRouter.all('/testTemp', controller.temp.testTemp);
  rootRouter.all('/accountDataCopy', controller.home.accountDataCopy);
  rootRouter.all('/queryYearInboundOutbound', controller.home.queryYearInboundOutbound);

  rootRouter.post('/customerRebuildIndex', controller.customer.rebuildCustomerIndex);
  rootRouter.post('/recoveryCustomerIndex', controller.customer.recoveryCustomerIndex);
  rootRouter.post('/changeCustomerIndex', controller.customer.changeCustomerIndex);
  rootRouter.post('/getRebuildAccount', controller.customer.getRebuildAccount);
  rootRouter.post('/getAccount', controller.customer.getAccount);
  rootRouter.all('/importCallLabel', controller.home.importCallLabel);
};
